{% extends "base_table.html" %}

{% block structure_tab_class %} active{% endblock %}

{% block inner_content %}
<h3>Add Index</h3>
<form action="{{ url_for('add_index', table=table) }}" class="form" method="post">
  <div class="form-group">
    <label for="id_indexed_columns">Indexed Columns</label>
    <select class="form-control" id="id_type" multiple="multiple" name="indexed_columns">
      {% for column in columns %}
        <option {% if column in indexed_columns %}selected="selected" {% endif %}value="{{ column.name }}">{{ column.name }} ({{ column.data_type }})</option>
      {% endfor %}
    </select>
  </div>
  <div class="form-group">
    <label for="id_unique">Unique?</label>
    <select class="form-control" id="id_unique" name="unique">
      <option value="">No</option>
      <option {% if unique %}selected="selected" {% endif %}value="y">Yes</option>
    </select>
  </div>
  <button class="btn btn-primary" type="submit">Add index</button>
  <a class="btn btn-secondary" href="{{ url_for('table_structure', table=table) }}">Cancel</a>
</form>
{% endblock %}
